<template>
  <el-form
    ref="formRef"
    style="max-width: 600px"
    :model="numberValidateForm"
    :rules="rulesAge"
    label-width="auto"
  >
    <el-form-item label="age" prop="age">
      <el-input v-model="numberValidateForm.age" type="text" autocomplete="off" />
    </el-form-item>
  </el-form>
</template>

<script setup>
import { reactive, ref } from 'vue'

const formRef = ref()

const numberValidateForm = reactive({
  age: '',
})

const rulesAge = {
  age: [
    { required: true, message: 'age is required', trigger: 'blur' },
    { type: 'number', message: 'age must be a number', trigger: 'blur' },
  ],
}
</script>
